import { ApolloQueryResult, FetchResult, FetchPolicy } from '@apollo/client/core';
import { Observable } from 'rxjs';
/**************************************************************************************
 * 用户认证
 */
/*************************************************************************************
 * 服务接口定义
 */
export interface AccountPasswordAuthServiceApi {
  getAccount(variables: AccountPasswordAuthService_getAccountVariables, options:AccountPasswordAuthServiceQueryOptions): Observable<ApolloQueryResult<AccountPasswordAuthService_getAccountResult>>; // 获取登陆信息
  login(variables: AccountPasswordAuthService_loginVariables, options:AccountPasswordAuthServiceQueryOptions): Observable<ApolloQueryResult<AccountPasswordAuthService_loginResult>>; // 登陆验证
  list(variables: AccountPasswordAuthService_listVariables, options:AccountPasswordAuthServiceQueryOptions): Observable<ApolloQueryResult<AccountPasswordAuthService_listResult>>; // 分页查询
  totalCount(): Observable<ApolloQueryResult<AccountPasswordAuthService_totalCountResult>>; // 统计库中所有对象的数据量
  search(variables: AccountPasswordAuthService_searchVariables, options:AccountPasswordAuthServiceQueryOptions): Observable<ApolloQueryResult<AccountPasswordAuthService_searchResult>>; // 游标查询
  loadAll(): Observable<ApolloQueryResult<AccountPasswordAuthService_loadAllResult>>; // 获取库中所有数据，数据量大时请谨慎使用
  getById(variables: AccountPasswordAuthService_getByIdVariables, options:AccountPasswordAuthServiceQueryOptions): Observable<ApolloQueryResult<AccountPasswordAuthService_getByIdResult>>; // 获取一个对象
  save(variables: AccountPasswordAuthService_saveVariables): Observable<FetchResult<AccountPasswordAuthService_saveResult>>; // 保存对象
  removeById(variables: AccountPasswordAuthService_removeByIdVariables): Observable<FetchResult<AccountPasswordAuthService_removeByIdResult>>; // 删除一个对象
  removeByIdList(variables: AccountPasswordAuthService_removeByIdListVariables): Observable<FetchResult<AccountPasswordAuthService_removeByIdListResult>>; // 删除一批对象
}
export interface AccountPasswordAuthServiceQueryOptions{
  cachePolicy:FetchPolicy;
  more:boolean;
}

/**
 * 获取登陆信息
 */
export interface AccountPasswordAuthService_getAccountResult{
    accountPasswordAuthService_getAccount: AuthAccountPackage;
}
export interface AccountPasswordAuthService_getAccountVariables{
      token?: string; // 令牌
}

/**
 * 登陆验证
 */
export interface AccountPasswordAuthService_loginResult{
    accountPasswordAuthService_login: AuthAccountPackage;
}
export interface AccountPasswordAuthService_loginVariables{
      tenantCode: string; // 学校/机构
      account: string; // 登陆账号
      password: string; // 认证密码
}

/**
 * 分页查询
 */
export interface AccountPasswordAuthService_listResult{
    accountPasswordAuthService_list: AuthAccountConnection;
}
export interface AccountPasswordAuthService_listVariables{
      filter: AccountFilter; // 过滤条件
      orderBy?: AuthAccountOrderBy; // 排序方式
}

/**
 * 统计库中所有对象的数据量
 */
export interface AccountPasswordAuthService_totalCountResult{
    accountPasswordAuthService_totalCount: number;
}

/**
 * 游标查询
 */
export interface AccountPasswordAuthService_searchResult{
    accountPasswordAuthService_search: AuthAccountConnection;
}
export interface AccountPasswordAuthService_searchVariables{
      first: number; // 获取数据量
      offset: number; // 获取数据起始位置
      filter: AccountFilter; // 过滤条件
      orderBy?: AuthAccountOrderBy; // 排序方式
}

/**
 * 获取库中所有数据，数据量大时请谨慎使用
 */
export interface AccountPasswordAuthService_loadAllResult{
    accountPasswordAuthService_loadAll: AuthAccountConnection;
}

/**
 * 获取一个对象
 */
export interface AccountPasswordAuthService_getByIdResult{
    accountPasswordAuthService_getById: AuthAccountPackage;
}
export interface AccountPasswordAuthService_getByIdVariables{
      id: string; // 对象的ID值
}


export interface AccountPasswordAuthService_saveResult{
  accountPasswordAuthService_save: AuthAccountMutationInfo;
}

/**
 * 保存对象
 */
export interface AccountPasswordAuthService_saveVariables{
    entity: AccountInput; // 保存对象，无id值新增，有id值修改，如果修改未找到对象则抛出异常修改失败
}

export interface AccountPasswordAuthService_removeByIdResult{
  accountPasswordAuthService_removeById: AuthAccountMutationInfo;
}

/**
 * 删除一个对象
 */
export interface AccountPasswordAuthService_removeByIdVariables{
    id: string; // 对象ID值
}

export interface AccountPasswordAuthService_removeByIdListResult{
  accountPasswordAuthService_removeByIdList: AuthAccountMutationInfo;
}

/**
 * 删除一批对象
 */
export interface AccountPasswordAuthService_removeByIdListVariables{
    ids: string[]; // 对象ID值列表
}
/**
 * 错误信息
 */
export interface AuthAccountErrorBody {
  message: string;
  stackTrace: string;
}

/**
 * 查询结果信息
 */
export interface AuthAccountResultInfo {
  totalCount: number;
  queryTime: number;
  sign: string;
  message: string;
}

/**
 * 分页信息
 */
export interface AuthAccountPageInfo{
  page: number;
  size: number;
  offset: number;
  endCursor: string;
  hasNextPage: boolean;
}

/**
 * 查询集合返回对象
 */
export interface  AuthAccountConnection{
  resultInfo: AuthAccountResultInfo;
  edges: ProfileViewViewEdge[];
  pageInfo: AuthAccountPageInfo;
  uuid: string;
}
export interface ProfileViewViewEdge{
  node:ProfileViewView;
}
/**
 * 查询单个对象返回结果
 */
export interface AuthAccountPackage{
  resultInfo: AuthAccountResultInfo;
  entity: ProfileViewView;
  uuid: string;
}

/**
 * 排序类型
 */
export interface AuthAccountOrderBy {
  field: string;
  type: 'ASC' | 'DESC';
}

/**
 * 更新返回结果信息
 */
export interface AuthAccountMutationInfo {
  status: boolean;
  rows: number;
  messages: string;
  uuid: string;
  sign: string;
  executeTime: number;
  result: ProfileViewView;
}

/**
 * 字符串筛选接口
 */
export interface AuthAccountStringFilter {
  eq?: string;
  neq?: string;
  like?: string;
  in?: string[];
  nin?: string[];
  gt?: string;
  lt?: string;
  gte?: string;
  lte?: string;
}

/**
 * 数字过滤条件接口
 */
export interface AuthAccountNumberFilter {
  eq?: number;
  neq?: number;
  in?: number[];
  nin?: number[];
  gt?: number;
  lt?: number;
  gte?: number;
  lte?: number;
}

/**
 * 布尔类型删选接口
 */
export interface AuthAccountBooleanFilter {
  eq?: boolean;
  neq?: boolean;
}




/*****************************************************************************************
 * 查询接口
 */
export const accountPasswordAuthServiceQuery = {
   // 获取登陆信息
  accountPasswordAuthService_getAccount: `accountPasswordAuthService_getAccount(token:$token){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    entity{
      status
      message
      token
      account
      name
      tenantView
        {
      id
      domain
      code
      name
      logo
      vip
      cloudSize
      startDate
      endDate
      master
      phone
      addr
      longitude
      latitude
      tenantType
      memo
      online
        }
      accountTypes
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
    }
    uuid
  }`
, // 登陆验证
  accountPasswordAuthService_login: `accountPasswordAuthService_login(tenantCode:$tenantCode,account:$account,password:$password){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    entity{
      status
      message
      token
      account
      name
      tenantView
        {
      id
      domain
      code
      name
      logo
      vip
      cloudSize
      startDate
      endDate
      master
      phone
      addr
      longitude
      latitude
      tenantType
      memo
      online
        }
      accountTypes
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
    }
    uuid
  }`
, // 分页查询
  accountPasswordAuthService_list: `accountPasswordAuthService_list(filter:$filter,orderBy:$orderBy){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    edges{
      node{
      status
      message
      token
      account
      name
      tenantView
        {
      id
      domain
      code
      name
      logo
      vip
      cloudSize
      startDate
      endDate
      master
      phone
      addr
      longitude
      latitude
      tenantType
      memo
      online
        }
      accountTypes
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
        }
    }
    pageInfo{
      page
      size
      offset
      hasNextPage
      endCursor
    }
    uuid
  }`
, // 统计库中所有对象的数据量
  accountPasswordAuthService_totalCount: `accountPasswordAuthService_totalCount`
, // 游标查询
  accountPasswordAuthService_search: `accountPasswordAuthService_search(first:$first,offset:$offset,filter:$filter,orderBy:$orderBy){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    edges{
      node{
      status
      message
      token
      account
      name
      tenantView
        {
      id
      domain
      code
      name
      logo
      vip
      cloudSize
      startDate
      endDate
      master
      phone
      addr
      longitude
      latitude
      tenantType
      memo
      online
        }
      accountTypes
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
        }
    }
    pageInfo{
      page
      size
      offset
      hasNextPage
      endCursor
    }
    uuid
  }`
, // 获取库中所有数据，数据量大时请谨慎使用
  accountPasswordAuthService_loadAll: `accountPasswordAuthService_loadAll{
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    edges{
      node{
      status
      message
      token
      account
      name
      tenantView
        {
      id
      domain
      code
      name
      logo
      vip
      cloudSize
      startDate
      endDate
      master
      phone
      addr
      longitude
      latitude
      tenantType
      memo
      online
        }
      accountTypes
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
        }
    }
    pageInfo{
      page
      size
      offset
      hasNextPage
      endCursor
    }
    uuid
  }`
, // 获取一个对象
  accountPasswordAuthService_getById: `accountPasswordAuthService_getById(id:$id){
    resultInfo{
      totalCount
      queryTime
      sign
      message
    }
    entity{
      status
      message
      token
      account
      name
      tenantView
        {
      id
      domain
      code
      name
      logo
      vip
      cloudSize
      startDate
      endDate
      master
      phone
      addr
      longitude
      latitude
      tenantType
      memo
      online
        }
      accountTypes
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
    }
    uuid
  }`
};

/*********************************************************************
 * 更新接口信息
 */
export const accountPasswordAuthServiceMutation = {
   // 保存对象
  accountPasswordAuthService_save: `accountPasswordAuthService_save(entity:$entity){
    status
    rows
    messages
    uuid
    sign
    executeTime
    result{
      status
      message
      token
      account
      name
      tenantView
        {
      id
      domain
      code
      name
      logo
      vip
      cloudSize
      startDate
      endDate
      master
      phone
      addr
      longitude
      latitude
      tenantType
      memo
      online
        }
      accountTypes
      tenantId
      tenant
      tenantCode
      tenantName
      creator
      creatorId
      creatorCode
      creatorName
      createDateTime
      lastModifiedDateTime
      sortNum
      id
    }
    errorBody{
      message
      stackTrace
    }
  }`
, // 删除一个对象
  accountPasswordAuthService_removeById: `accountPasswordAuthService_removeById(id:$id){
    status
    rows
    messages
    uuid
    sign
    executeTime

    errorBody{
      message
      stackTrace
    }
  }`
, // 删除一批对象
  accountPasswordAuthService_removeByIdList: `accountPasswordAuthService_removeByIdList(ids:$ids){
    status
    rows
    messages
    uuid
    sign
    executeTime

    errorBody{
      message
      stackTrace
    }
  }`
};

/************************************************************************
 * 类型信息
 */
/**
 * 登陆账户
 */
export interface AccountStore {
  account?: string; // 账户名称
  accountTypes?: string; // 用户身份
  activated?: boolean; // 是否激活
  tenantId?: string; // 租户ID
  tenant?: string; // 租户快照信息
  tenantCode?: string; // 租户编号
  tenantName?: string; // 租户名称
  creator?: string; // 创建人快照信息
  creatorId?: string; // 创建人ID
  creatorCode?: string; // 创建人账号
  creatorName?: string; // 创建人姓名
  createDateTime?: number; // 创建时间
  lastModifiedDateTime?: number; // 最后修改时间
  sortNum?: number; // 默认排序字段
  id?: number; // 未说明
  [props: string]: any;
}
/**
 * 登陆认证结果信息
 */
export interface ProfileViewView {
  status?: boolean; // 登陆状态
  message?: string; // 登陆提醒
  token?: string; // 登陆会话
  account?: string; // 账户名称
  name?: string; // 名称
  tenantView?: TenantView; // 登陆人学校
  accountTypes?: string; // 登陆人身份
  tenantId?: string; // 租户ID
  tenant?: string; // 租户快照信息
  tenantCode?: string; // 租户编号
  tenantName?: string; // 租户名称
  creator?: string; // 创建人快照信息
  creatorId?: string; // 创建人ID
  creatorCode?: string; // 创建人账号
  creatorName?: string; // 创建人名称
  createDateTime?: number; // 创建时间
  lastModifiedDateTime?: number; // 最后修改时间
  sortNum?: number; // 默认排序字段
  id?: string; // 未说明
  [props: string]: any;
}
/**
 * 登陆账户
 */
export interface AccountInput {
  account?: string; // 账户名称
  accountTypes?: string; // 用户身份
  activated?: boolean; // 是否激活
  tenantId?: string; // 租户ID
  tenant?: string; // 租户快照信息
  tenantCode?: string; // 租户编号
  tenantName?: string; // 租户名称
  creator?: string; // 创建人快照信息
  creatorId?: string; // 创建人ID
  creatorCode?: string; // 创建人账号
  creatorName?: string; // 创建人姓名
  createDateTime?: number; // 创建时间
  lastModifiedDateTime?: number; // 最后修改时间
  sortNum?: number; // 默认排序字段
  id?: number; // 未说明
  [props: string]: any;
}
/**
 * 登陆账户
 */
export interface AccountFilter {
  account?: AuthAccountStringFilter; // 账户名称
  accountTypes?: AuthAccountStringFilter; // 用户身份
  activated?: AuthAccountBooleanFilter; // 是否激活
  tenantId?: AuthAccountStringFilter; // 租户ID
  tenant?: AuthAccountStringFilter; // 租户快照信息
  tenantCode?: AuthAccountStringFilter; // 租户编号
  tenantName?: AuthAccountStringFilter; // 租户名称
  creator?: AuthAccountStringFilter; // 创建人快照信息
  creatorId?: AuthAccountStringFilter; // 创建人ID
  creatorCode?: AuthAccountStringFilter; // 创建人账号
  creatorName?: AuthAccountStringFilter; // 创建人姓名
  createDateTime?: AuthAccountNumberFilter; // 创建时间
  lastModifiedDateTime?: AuthAccountNumberFilter; // 最后修改时间
  sortNum?: AuthAccountNumberFilter; // 默认排序字段
  id?: AuthAccountNumberFilter; // 未说明
  [props: string]: any;
}
/**
 * 租户信息
 */
export interface TenantView {
  id?: string; // 主键
  domain?: string; // 域名
  code?: string; // 编码
  name?: string; // 名称
  logo?: string; // LOGO160*160
  vip?: number; // 会员等级
  cloudSize?: number; // 网盘空间
  startDate?: number; // 账号有效期
  endDate?: number; // 账号有效期
  master?: string; // 联系人
  phone?: string; // 联系手机
  addr?: string; // 地址
  longitude?: number; // 经度
  latitude?: number; // 纬度
  tenantType?: 'TEACHER' | 'TEAM' | 'TRAIN' | 'SCHOOL' | 'ENP'; // 未说明
  memo?: string; // 未说明
  online?: boolean; // 上线或下线
  [props: string]: any;
}
